<template>
    <div>
        <el-table :data="tableData" border style="width: 100%">
            <el-table-column type="index" label="序号" width="100" />
            <el-table-column prop="sid" label="工号" width="180" />
            <el-table-column prop="snameC" label="姓名" width="180" />
        </el-table>
    </div>
</template>

<script setup>
import { onMounted, reactive, ref } from 'vue';
import { getUserlist } from '@/api/users'
import { ElMessage } from 'element-plus'

const tableData = ref([])

onMounted(async() => {
    await getUsers()
})

const getUsers =  async() => {
    await getUserlist().then( res => {
        if( res.code == 200 ) {
            tableData.value = res.data
        } else {
            ElMessage.error('用户名或密码错误.')
        }
    })
}

</script>

<style lang="scss" scoped>

</style>